Trying to do EDA
packages = c('maptools', 'sf', 'raster','spatstat', 'tmap','tidyverse','rgdal','ggplot2', 'ggthemes', 'plotly')
for (p in packages){
if(!require(p, character.only = T)){
install.packages(p)
}
library(p,character.only = T)
}
jakarta <- st_read(dsn = "data/Geospatial",
layer = "BATAS_DESA_DESEMBER_2019_DUKCAPIL_DKI_JAKARTA")
Reading layer `BATAS_DESA_DESEMBER_2019_DUKCAPIL_DKI_JAKARTA' from data source `C:\nxinyan\IS415_project\data\Geospatial' using driver `ESRI Shapefile'
Simple feature collection with 269 features and 161 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 106.3831 ymin: -6.370815 xmax: 106.9728 ymax: -5.184322
Geodetic CRS: WGS 84
Display basic information of the feature class
st_geometry(jakarta)
Geometry set for 269 features
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 106.3831 ymin: -6.370815 xmax: 106.9728 ymax: -5.184322
Geodetic CRS: WGS 84
First 5 geometries:
# Looking at the associated information in the dataframe
# glimpse(jakarta)
Identifying the different city in Jakarta
tmap_mode('view')
tm_shape(jakarta)+
tm_polygons() +
tm_shape(jakarta) +
tm_fill("KAB_KOTA",
palette = "RdYlBu")+
tm_borders()